<?php
/**
 * Created by PhpStrom
 * User: 郭碧云
 * Date: 2021/7/12 16:27
 * Desc:
 */

namespace App\Service;


class QuestionTypeService extends BaseService
{
    protected $modelName="QuestionType";

    /**
     * 验证编辑名称是否重复
     */
    public function hasName($id,$params){
        $info = $this->first(["name"=>$params["name"],"site_id"=>getCurrentSiteId()]);
        if (!empty($info)&&$info["id"]!=$id) {
            return false;
        }
        return true;
    }
}
